/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package MODEL;

import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.*;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author ahmed
 */
@Entity
@Table(name = "ITEM")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Item.findAll", query = "SELECT i FROM Item i"),
    @NamedQuery(name = "Item.findByIdItem", query = "SELECT i FROM Item i WHERE i.idItem = :idItem"),
    @NamedQuery(name = "Item.findByCategorie", query = "SELECT i FROM Item i WHERE i.categorie = :categorie"),
    @NamedQuery(name = "Item.findByDecriptionDetaille", query = "SELECT i FROM Item i WHERE i.decriptionDetaille = :decriptionDetaille"),
    @NamedQuery(name = "Item.findByDescriptionCourte", query = "SELECT i FROM Item i WHERE i.descriptionCourte = :descriptionCourte"),
    @NamedQuery(name = "Item.findByNom", query = "SELECT i FROM Item i WHERE i.nom = :nom"),
    @NamedQuery(name = "Item.findByProduit", query = "SELECT i FROM Item i WHERE i.produit = :produit"),
    @NamedQuery(name = "Item.findByQuantite", query = "SELECT i FROM Item i WHERE i.quantite = :quantite"),
    @NamedQuery(name = "Item.findByQuantiteComande", query = "SELECT i FROM Item i WHERE i.quantiteComande = :quantiteComande"),
    @NamedQuery(name = "Item.findByRef", query = "SELECT i FROM Item i WHERE i.ref = :ref"),
    @NamedQuery(name = "Item.findBySeuil", query = "SELECT i FROM Item i WHERE i.seuil = :seuil")})
public class Item implements Serializable {
    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @Basic(optional = false)
    @Column(name = "ID_ITEM")
    @GeneratedValue(strategy= GenerationType.AUTO)
    private BigDecimal idItem;
    @Column(name = "CATEGORIE")
    private String categorie;
    @Column(name = "DECRIPTION_DETAILLE")
    private String decriptionDetaille;
    @Column(name = "DESCRIPTION_COURTE")
    private String descriptionCourte;
    @Column(name = "NOM")
    private String nom;
    @Column(name = "PRODUIT")
    private BigDecimal produit;
    @Column(name = "QUANTITE")
    private BigDecimal quantite;
    @Column(name = "QUANTITE_COMANDE")
    private BigDecimal quantiteComande;
    @Column(name = "REF")
    private String ref;
    @Column(name = "SEUIL")
    private BigDecimal seuil;

    public Item() {
    }

    public Item(BigDecimal idItem) {
        this.idItem = idItem;
    }

    public BigDecimal getIdItem() {
        return idItem;
    }

    public void setIdItem(BigDecimal idItem) {
        this.idItem = idItem;
    }

    public String getCategorie() {
        return categorie;
    }

    public void setCategorie(String categorie) {
        this.categorie = categorie;
    }

    public String getDecriptionDetaille() {
        return decriptionDetaille;
    }

    public void setDecriptionDetaille(String decriptionDetaille) {
        this.decriptionDetaille = decriptionDetaille;
    }

    public String getDescriptionCourte() {
        return descriptionCourte;
    }

    public void setDescriptionCourte(String descriptionCourte) {
        this.descriptionCourte = descriptionCourte;
    }

    public String getNom() {
        return nom;
    }

    public void setNom(String nom) {
        this.nom = nom;
    }

    public BigDecimal getProduit() {
        return produit;
    }

    public void setProduit(BigDecimal produit) {
        this.produit = produit;
    }

    public BigDecimal getQuantite() {
        return quantite;
    }

    public void setQuantite(BigDecimal quantite) {
        this.quantite = quantite;
    }

    public BigDecimal getQuantiteComande() {
        return quantiteComande;
    }

    public void setQuantiteComande(BigDecimal quantiteComande) {
        this.quantiteComande = quantiteComande;
    }

    public String getRef() {
        return ref;
    }

    public void setRef(String ref) {
        this.ref = ref;
    }

    public BigDecimal getSeuil() {
        return seuil;
    }

    public void setSeuil(BigDecimal seuil) {
        this.seuil = seuil;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idItem != null ? idItem.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Item)) {
            return false;
        }
        Item other = (Item) object;
        if ((this.idItem == null && other.idItem != null) || (this.idItem != null && !this.idItem.equals(other.idItem))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "MODEL.Item[ idItem=" + idItem + " ]";
    }
    
}
